package com.lazy.tcp;

import org.apache.log4j.Logger;
import org.jboss.netty.channel.ChannelFuture;
import org.jboss.netty.channel.ChannelFutureListener;

public class AysncChannelFutureListener implements ChannelFutureListener {
    private static Logger logger = Logger.getLogger("LbsChannelFutureListener");

    private String tag;
    public AysncChannelFutureListener(String tag) {
        this.tag = tag;
    }
    
    @Override
    public void operationComplete(ChannelFuture future) throws Exception{
        if (future.isSuccess()) {
            // Connection attempt succeeded:
            logger.info("[" + tag + "]" + " send ok!!!");
        } else {
            // Close the connection if the connection attempt has failed.
            logger.info("[" + tag + "]" + "send fail!!!");
        }
    }

}
